package com.heima.file.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;

public class MinIoAutoConfiguration {

    @Autowired
    private MinIoProperties minIoProperties;

    @Bean
    public MinioClient buildMinioClient(){
        return MinioClient.builder().credentials(minIoProperties.getAccessKey(),
                minIoProperties.getSecretKey())
                .endpoint(minIoProperties.getEndpoint()).build();
    }
}
